import 'package:p_location/map/obj/risk_zone_info.dart';

class RiskZoneData {
    List<RiskZoneInfo> data;
    int length;

    RiskZoneData({this.data, this.length});

    factory RiskZoneData.fromJson(Map<String, dynamic> json) {
        return RiskZoneData(
            data: json['data'] != null ? (json['data'] as List).map((i) => RiskZoneInfo.fromJson(i)).toList() : null,
            length: json['length'], 
        );
    }

    Map<String, dynamic> toJson() {
        final Map<String, dynamic> data = new Map<String, dynamic>();
        data['length'] = this.length;
        if (this.data != null) {
            data['data'] = this.data.map((v) => v.toJson()).toList();
        }
        return data;
    }
}